package com.example.demo.task;

import javax.annotation.PostConstruct;
import java.util.HashSet;
import java.util.Set;

public abstract class AbstractHander {

    public abstract void process();

    private Set<Long> h = new HashSet<>();

    public void add(Long id) throws InterruptedException {
        Thread.sleep(1000L);
        h.add(id);
        System.out.println("set 的 hashcode"+h.hashCode() + ",size:" + h.size());
    }

    @PostConstruct
    public void init(){
        System.out.println(this.getClass());
    }
}
